import requests
import bs4
from bs4 import BeautifulSoup


# 获取网页结构
def GetStructure(url):
    head_setting = {
        "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0",

    }
    response = requests.get(url,headers=head_setting)
    if response.status_code == 200:
        soup = BeautifulSoup(response.text,'html.parser')






url = "https://www.baidu.com"
GetStructure(url)